package com.zbl.vo;

import com.xuxueli.crawler.annotation.PageFieldSelect;
import com.xuxueli.crawler.annotation.PageSelect;
import com.xuxueli.crawler.conf.XxlCrawlerConf;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.List;

/**
 * @decription: 京东商品
 * @url: https://mall.jd.com/view_search-407907-13637358-99-1-20-1.html
 */
@Data
@PageSelect(cssQuery = "body")
public class JDItemVo {

    @PageFieldSelect(cssQuery = ".j-module li .jGoodsInfo .jDesc a")
    private List<String> titles;

    //爬取商品图片
    @Field("images")
    @PageFieldSelect(cssQuery = ".j-module li .jPic a img",selectVal = "abs:src", selectType = XxlCrawlerConf.SelectType.ATTR)
    private List<String> images;

    //京东价格爬取不了
    /*@Field("prices")
    @PageFieldSelect(cssQuery = ".j-module li .jGoodsInfo .jPrice .jdPrice", selectType = XxlCrawlerConf.SelectType.HTML)
    private List<String> prices;*/

}